<?php

namespace app\common\model;

use think\Model;
use traits\model\SoftDelete;

/**
 * 会员积分日志模型
 */
class UserSendLog Extends Model
{
//    use SoftDelete;
    // 表名
//    protected $name = 'user_score_log';
    // 开启自动写入时间戳字段
//    protected $autoWriteTimestamp = 'int';
//    // 定义时间戳字段名
//    // 定义时间戳字段名
//    protected $createTime = 'createtime';
//    protected $updateTime = '';
//    protected $deleteTime = '';
    // 追加属性
//    protected $append = [
//    ];
    //获取种子记录
    public static function getsendlist($user_id,$status=0,$type=0,$field='*'){
        $where['user_id']=$user_id;
        if($status!=0)
            $where['status']=$status;
        if($type!=0)
            $where['type']=$type;
        $list =  self::where($where)
            ->field($field)
            ->order('id asc')
            ->paginate();
        foreach ($list as $k=>$v){
            $v['createtime']=date('Y-m-d H:i:s',$v['createtime']);
        }
        return $list;
    }
}
